// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import ViewUI from 'view-design'
import 'view-design/dist/styles/iview.css'
import {
    Poptip
} from 'view-design'
import i18n from '@/locale'
import config from '@/config'
import QiniuUpload from '@/components/QiniuUpload'
import NEditor from '@/components/NEditor'
import importDirective from '@/directive'
import 'iview/dist/styles/iview.css'
import './index.less'
import '@/assets/icons/iconfont.css'

Vue.use(ViewUI, {
    i18n: function (path, options) {
        let value = i18n.t(path, options);
        if (value !== null && value !== undefined) return value;
        return '';
    }
})

Vue.config.productionTip = false
Vue.component('QiniuUpload', QiniuUpload)
Vue.component('NEditor', NEditor)
Vue.component('IPoptip', Poptip)
/**
 * @description 全局注册应用配置
 */
Vue.prototype.$config = config
/**
 * 注册指令
 */
importDirective(Vue)

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    i18n,
    store,
    render: h => h(App),
})
